package com.qk.management.mapper;

import com.qk.entity.Role;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 *@author ZLJ
 *@date 2025/10/8 13:37
 *@Description
 */
@Mapper
@SuppressWarnings("all")
public interface RoleMapper {
    @Insert("insert into role (name,label,remark,create_time,update_time) values (#{name},#{label},#{remark},#{createTime},#{updateTime})")
    void insert(Role role);

    @Select("select * from role where id = #{id}")
    Role selectById(Integer id);

    void update(Role role);

    @Delete("delete from role where id = #{id}")
    void deleteById(Integer id);

    Integer count(String name);

    List<Role> selectByPage(String name, Integer offset, Integer pageSize);

    @Select("select * from role")
    List<Role> selectAll();
}
